package stats.web;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MainController {

    private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");

    @RequestMapping("main")
    public ModelAndView getApplicationRoot() {
        ModelAndView mnv = new ModelAndView();
        mnv.setViewName("main-page");
        mnv.addObject("currentTime", sdf.format(new Date()));
        return mnv;
    }

}
